from django.db import models

# 产品表
class Goods(models.Model):
    '''图片  标题  价格'''
    img=models.ImageField(upload_to='img')
    title=models.CharField(max_length=128)
    price1=models.DecimalField(max_digits=9,decimal_places=2)
    price2 = models.DecimalField(max_digits=9, decimal_places=2)


# 用户表
class User(models.Model):
    username=models.CharField(max_length=32)
    password=models.CharField(max_length=225)



# 订单表
class Order(models.Model):
    user=models.ForeignKey('User',on_delete=models.CASCADE)
    goods=models.ForeignKey('Goods',on_delete=models.CASCADE)
    name=models.CharField(max_length=32)
    phone=models.CharField(max_length=32)

